<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Rep\MaterialSpecificationRep;
use Illuminate\Http\Request;

class MaterialSpecification extends Controller
{
    //材料规格
    protected $rep;

    public function __construct(Request $request)
    {
        $this->rep = new MaterialSpecificationRep();
    }

    /**
     * @param Request $request
     */
    public function getMaterialSpecificationList(Request $request){
        $params = $request->all();
        $data = $this->rep->getMaterialSpecificationListRep($params);
        return re(0,$data,'success');
    }

    /**
     * @param Request $request
     */
    public function createMaterialSpecification(Request $request){
        $params = $request->all();
        $data = $this->rep->createMaterialSpecificationRep($params);
        return re($data['code'],$data['data']);
    }

    /**
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function delMaterialSpecification(Request $request){
        $params = $request->all();
        $data = $this->rep->delMaterialSpecificationRep($params);
        return re($data['code']);
    }


}
